Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakpoint improvements #1809

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

rocketz
Copy link
Contributor

@rocketz rocketz commented Nov 24, 2024

  • Cleaned up UI. New breakpoints are now handled in a pop-up dialog
  • Breakpoint are now shown in a table.
  • You can easily see and edit breakpoint names in the table
  • Clicking on the address will take you there (in asm or memory view)
  • Enable all/disable all/delete all buttons
  • Context menu in assembly view to quickly create read/write breakpoints on the address the instruction reads/writes
  • New breakpoint types:
  • On changes. WIll only break when the value is written to with a change. The new value written is the new value tested against
  • Lower than
  • Higher than
  • Equal
  • Range
  • When a code breakpoint is hit it is highlighted in red in breakpoint table

- Cleaned up UI. New breakpoints are now handled in a pop-up dialog
- Breakpoint are now shown in a table.
- You can easily see and edit breakpoint names in the table
- Clicking on the address will take you there (in asm or memory view)
- Enable all/disable all/delete all buttons
- Context menu in assembly view to quickly create read/write breakpoints on the address the instruction reads/writes
- New breakpoint types:
* On changes. WIll only break when the value is written to with a change. The new value written is the new value tested against
* Lower than
* Higher than
* Equal
* Range
- When a code breakpoint is hit it is highlighted in red in breakpoint table
Copy link
Member

@nicolasnoble nicolasnoble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for doing this!

It's Thanksgiving break over here, so I'm a bit slower than usual (and I'm already not too fast to begin with), so, sorry about the delay here.

I've left a few comments, but it looks good!

#include "fmt/format.h"
#include "imgui.h"
#include "support/imgui-helpers.h"

static ImVec4 s_currentColor = ImColor(0xff, 0xeb, 0x3b);
// Note: We ignore SWL and SWR
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a bit of a blind spot overall. It feels like we can properly support swl/swr. I'll try and work this out a bit.

MemVal final = {};
switch (width) {
case 1: {
uint8_t val = PCSX::g_emulator->m_mem->read8(addr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't use read8/read16/read32 for the purpose of the debugger, as it may advance internal state machines on things like the cd-rom controller or the pads. This one's a bit difficult.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see.. maybe we need a more direct access?

doBreak = curVal != self->conditionData();
if (doBreak)
{
// TODO: can't update since 'self' is const
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you fill in what'd need to be updated still? It's probably doable to make everything work properly still. It may be fine to also change the upper API generally speaking, but I'd rather we discuss this a bit. We could also use mutable within reason.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually have this working, but I messed up with some stashes. Will bring those changes in.

// than that they want to use the same label twice
m_bpLabelString[0] = 0;

static int breakCondition2 = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we name this breakConditionImGuiValue instead or something? The 2 suffix doesn't really explain why it's there in the first place.

@rocketz
Copy link
Contributor Author

rocketz commented Nov 29, 2024

Thanks for doing this!

My pleasure!

It's Thanksgiving break over here, so I'm a bit slower than usual (and I'm already not too fast to begin with), so, sorry about the delay here.

No worries. You shouldn't waste valuable turkey-time on this :)

I've left a few comments, but it looks good!

Cool. I'll fix a few things though.

@nicolasnoble
Copy link
Member

Updating from main as there was some CI breakages, and we can see better where we're at here.

@nicolasnoble
Copy link
Member

Right so there's still some breakages on Linux:

src/gui/widgets/breakpoints.cc:242:32: error: format not a string literal and no format arguments [-Werror=format-security]

Needs to use TextUnformatted for these strings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants